package com.example.test01;

import java.io.FileInputStream;
import java.io.InputStreamReader;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.widget.TextView;

public class Smi extends Activity {

	TextView tvSmiTest;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_smi);
        
        tvSmiTest = (TextView)findViewById(R.id.tvSmiTest);
        
        Intent intent=getIntent();
  	  	Bundle b1=intent.getExtras();
  	  	String smiPath=b1.getString("smiPath");
  	  	
  	  	FileInputStream fis=null;
  	  	InputStreamReader isr=null;
  	  	
  	  try{	
  		  fis=new FileInputStream
			   (smiPath);
  		  isr=new InputStreamReader(fis,"utf-8");	
  		  StringBuilder str=new StringBuilder();
  		  int ch=0;
  		  while((ch=isr.read())!=-1){
  			  str.append((char)ch);
  		  }
  		  tvSmiTest.setText(str.toString());
	   }catch (Exception ex){
		// TODO: handle exception
	}
    }

 
}
